
MESSAGE(STATUS "3rd:${SC_3RDPARTY_DIR}")

FIND_PATH(OPENCV_INCLUDE_DIR opencv2/core.hpp
  PATHS
  $ENV{OPENCV_DIR}
  $ENV{SC_3RDPARTY_DIR}/include
  ${SC_3RDPARTY_DIR}/include
  NO_DEFAULT_PATH
    PATH_SUFFIXES include
)

FIND_PATH(OPENCV_INCLUDE_DIR opencv2/core.hpp
    PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
    NO_DEFAULT_PATH
    PATH_SUFFIXES include
)

FIND_PATH(OPENCV_INCLUDE_DIR opencv2/core.hpp
  PATHS
  ~/Library/Frameworks/opencv.framework/Headers
  /Library/Frameworks/opencv.framework/Headers
  /usr/local/include/opencv
  /usr/local/include/opencv2
  /usr/local/include
  /usr/include/opencv
  /usr/include/opencv2
  /usr/include
  /sw/include/opencv
  /sw/include/opencv2
  /sw/include # Fink
  /opt/local/include/opencv
  /opt/local/include/opencv2
  /opt/local/include # DarwinPorts
  /opt/csw/include/opencv
  /opt/csw/include/opencv2
  /opt/csw/include # Blastwave
  /opt/include/opencv
  /opt/include/opencv2
  /opt/include
)

FIND_LIBRARY(OPENCV_LIBRARY 
  NAMES opencv_world411 opencv
  PATHS
  $ENV{OPENCV_DIR}
  $ENV{SC_3RDPARTY_DIR}/lib
  ${SC_3RDPARTY_DIR}/lib
  NO_DEFAULT_PATH
  PATH_SUFFIXES lib64 lib opencv2
)

FIND_LIBRARY(OPENCV_LIBRARY 
  NAMES opencv_world411 opencv
  PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
    NO_DEFAULT_PATH
    PATH_SUFFIXES lib64 lib opencv2
)
FIND_LIBRARY(OPENCV_LIBRARY 
  NAMES opencv_world411 opencv
  PATHS
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt
    /usr/freeware
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;GDAL_ROOT]/lib
  PATH_SUFFIXES lib64 lib
)


FIND_LIBRARY(OPENCV_LIBRARY_DEBUG 
  NAMES opencv_world411d opencv
  PATHS
  $ENV{OPENCV_DIR}
  $ENV{SC_3RDPARTY_DIR}/lib
  ${SC_3RDPARTY_DIR}/lib
  NO_DEFAULT_PATH
  PATH_SUFFIXES lib64 lib opencv2
)

FIND_LIBRARY(OPENCV_LIBRARY_DEBUG 
  NAMES opencv_world411d opencv
  PATHS ${CMAKE_PREFIX_PATH} # Unofficial: We are proposing this.
    NO_DEFAULT_PATH
    PATH_SUFFIXES lib64 lib opencv2
)
FIND_LIBRARY(OPENCV_LIBRARY_DEBUG 
  NAMES opencv_world411d opencv
  PATHS
    ~/Library/Frameworks
    /Library/Frameworks
    /usr/local
    /usr
    /sw
    /opt/local
    /opt/csw
    /opt
    /usr/freeware
    [HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\Session\ Manager\\Environment;GDAL_ROOT]/lib
  PATH_SUFFIXES lib64 lib
)

SET(OPENCV_FOUND "NO")
IF(OPENCV_LIBRARY AND OPENCV_LIBRARY_DEBUG AND OPENCV_INCLUDE_DIR)
  SET(OPENCV_FOUND "YES")
ENDIF(OPENCV_LIBRARY AND OPENCV_LIBRARY_DEBUG AND OPENCV_INCLUDE_DIR)



